package es.udima.geo.geoserver.entities;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Calendar;

public class GpsDataPK implements Serializable {

    private static final long serialVersionUID = 1L;

    private String userId;
    private Calendar fetchTime;

    public GpsDataPK() {
    }

    public String getUserId() {
	return userId;
    }

    public void setUserId(String userId) {
	this.userId = userId;
    }

    public Calendar getFetchTime() {
	return fetchTime;
    }

    public void setFetchTime(Calendar fetchTime) {
	this.fetchTime = fetchTime;
    }

    @Override
    public boolean equals(Object o) {
	boolean res = false;
	if (o instanceof GpsDataPK) {
	    GpsDataPK ot = (GpsDataPK) o;
	    res = this.getUserId().equals(ot.getUserId()) && this.getFetchTime().getTime() == ot.getFetchTime().getTime();
	}
	return res;
    }
    
    @Override
    public int hashCode() {
	return this.getFetchTime().hashCode() + this.getUserId().hashCode();
    }
}
